package com.nhimeye.domain;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import org.springframework.roo.addon.equals.RooEquals;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.jsf.model.RooUploadedFile;
import org.springframework.roo.addon.serializable.RooSerializable;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
@RooEquals
@RooSerializable
public class FileVersion extends AbstractItemVersion {

    @RooUploadedFile(contentType = "application/pdf")
    @Lob
    private byte[] content;

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fileVersion")
    private Set<FieldValue> fieldValues = new HashSet<FieldValue>();
}
